Skip to main content

Process Files for Knowledge Base

Used to accept and process one or more files to be included in the knowledge base. This typically involves parsing, extracting content, and indexing the data for later retrieval and use by AI agents.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/kb/file

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/file' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"file_ids": [
"file_001",
"file_002",
"file_003"
]
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"project_key": "string",
"agent_id": "string",
"file_ids": ["string"]
}

Request Body Parameters

FieldTypeRequiredDescription
project_keystringYesThe project key for your project.
agent_idstringYesUUID of the AI agent to associate the files with.
file_idsarrayYesArray of file identifiers to process and add to the knowledge base.
note

Files must be uploaded to the system before they can be processed. The file_ids should reference previously uploaded files.

Response

Success Response (200 OK)

Returns an object containing the processing status.

{
"is_success": true,
"detail": "Files processed and added to knowledge base successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the file processing was successful.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).
tip

The processing of files may take some time depending on the file size and content complexity. The files will be parsed, content will be extracted, and the data will be indexed for retrieval by the AI agent.

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"file_ids"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid file IDs or processing errorBad Request
422Validation Error - Invalid request parametersUnprocessable Entity